package com.yonyou.pmclouds.plan.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.measureindex.entity.MeasureIndexHistoryVO;
import com.yonyou.pmclouds.plan.entity.ScheduleItemVO;
import com.yonyou.pmclouds.plan.entity.ScheduleReportVO;

import java.util.List;
import java.util.Map;

/**
 *
 * @Description: 计划任务查询类
 * @Author: zhangzhonghao
 * @Date: 2020-03-06
 *
 */
public interface IScheduleItemQueryService {

    /**
     * 通过根结点主键查询所有任务项
     * @param pkRoots 根结点主键
     * @return 全部任务项
     */
    List<ScheduleItemVO> queryByPkRoots(String[] pkRoots) throws BusinessException;

    /**
     * 根据任务主键查询任务项，附带子级节点
     * @param pkItems 任务项主键
     * @return 任务项
     */
    List<ScheduleItemVO> queryByPkItems(String[] pkItems) throws BusinessException;

    /**
     * 根据计划主键查询所有任务项
     * @param pkSchedules 计划主键
     * @return key为计划主键，value为该计划下的任务项
     */
    Map<String, List<ScheduleItemVO>> queryByPkSchedules(String[] pkSchedules) throws BusinessException;

    /**
     * 根据计划主键查询所有任务项，按根节点进行汇总，只返回根结点，子节点在父节点下
     * @param pkSchedules 计划主键
     * @return key为计划主键，value为该计划下的任务项
     */
    Map<String, List<ScheduleItemVO>> queryByPkSchedulesOnlyRoot(String[] pkSchedules) throws BusinessException;

    List<ScheduleItemVO> queryByPkSchedulesOnlyEnd(String[] pkSchedules) throws BusinessException;

    /**
     *
     * @param pkItem
     * @return 查询任务填报详情
     */
    ScheduleReportVO queryByPkItem(String pkItem) throws BusinessException;

    Map<String, List<ScheduleItemVO>> queryChildPlanByParents(String[] pkParents);

    ScheduleItemVO[] queryByProjectAndRelatedBillType(String pkProject, String billType, String transiType) throws BusinessException;

    List<ScheduleItemVO> queryByProjectAndDependPlan(String pkProject, String[] dependPlans);

    /**
     * 查询计划指标对应的实际指标填报
     */
    MeasureIndexHistoryVO[] selectMeasureIndexVOByPlanIndex(String[] pkPlanIndex);

}
